const { merge } = require('webpack-merge')
const CommonWebpackConfig = require('./webpack.config.common')
const ProWebpackConfig = require('./webpack.config.production')
const DevWebpackConfig = require('./webpack.config.development')

// { WEBPACK_BUNDLE: true, WEBPACK_BUILD: true, mode: '' }
module.exports = function({mode}) {
  switch(mode) {
    case 'production':
      return merge(CommonWebpackConfig, ProWebpackConfig)
    case 'development':
      return merge(CommonWebpackConfig, DevWebpackConfig)
    default:
      return CommonWebpackConfig
  }
}

